# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=cpplint
pkgver=1.6.1_git20240320
pkgrel=1
_gitrev="3791cc41ac0afcea7b80a96cc3ca2fc71d73fcc0"
pkgdesc="Static code checker for C++"
url="https://github.com/cpplint/cpplint"
arch="noarch"
license="BSD-3-Clause"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
checkdepends="
	py3-pytest
	py3-pytest-cov
	py3-pytest-runner
	py3-pytest-timeout
	py3-testfixtures
	"
subpackages="$pkgname-pyc"
source="https://github.com/cpplint/cpplint/archive/$_gitrev/cpplint-$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$_gitrev"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
fca7eec2f08225d280b50d25268a00ad7bb2a01c16351363403e6463e4add163e5d5339aafd9167b2ef578653b9d61c8de19937f49cbb7c31d5207de7ac01358  cpplint-1.6.1_git20240320.tar.gz
"
